<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/**
 * 图片封装，调用图片采用该控制器
 */
Route::controller('img', 'ImgController');

/**
 * payment
 */
Route::controllers([
    'test-payment'          =>  'TestPaymentController',
    'payment'               =>  'PaymentController'
]);
/**
 * Admin
 */
Route::group(['namespace'=>'Admin','prefix'=>'admin'],function()
{
    Route::controller('auth', 'AuthController');
    //登录后
    Route::group(['middleware' => ['admin.auth']],function()
    {
        Route::get('/', ['uses'=>'IndexController@index']);
        Route::controllers([
            'menu'          =>  'MenuController',
            'admin-member'  =>  'AdminMemberController',
            'admin-group'   =>  'AdminGroupController',
            'admin-set'     =>  'AdminSetController',
            'admin-log'     =>  'AdminLogController',
            'member'        =>  'MemberController',
            'me'            =>  'MeController',
            'member-group'  =>  'MemberGroupController'
        ]);
        Route::group(['namespace'=>'Shop','prefix'=>'shop'],function()
        {
            Route::controllers([
                'store'             =>  'StoreController',
                'goods'             =>  'GoodsController',
                'order'             =>  'OrderController',
                'goods-classify'    =>  'GoodsClassifyController',
                'store-goods'       =>  'StoreGoodsController',
                'slide'             =>  'SlideController'
            ]);
        });
    });
});

/**
 * 微信
 */
//Route::group(['namespace'=>'Wx','prefix'=>'wx', 'middleware' => ['wechat.oauth']],function()
//{
//    Route::controllers([
//        'home'          =>  'IndexController',
//        'cart'          =>  'CartController',
//        'user'          =>  'UserController'
//    ]);
//});
/**
 * 商城
 */
Route::group(['namespace'=>'Shop','prefix'=>'', 'middleware' => ['wechat.oauth']],function()
{
    Route::group([],function()
    {
        Route::get('/', 'IndexController@getIndex');
        Route::any('index-ajax', 'IndexController@getIndexAjax');
        Route::controllers([
//            'index'             =>  'IndexController',
            'list'              =>  'ListController',
            'deal'              =>  'DealController',
            'user'              =>  'UserController'
        ]);
    });
    Route::controllers([
        'store-select'      =>  'StoreSelectController'
    ]);
});
/**
 * API
 */
Route::group(['namespace'=>'Api','prefix'=>'api'],function()
{
    Route::controllers([
        'wechat'    =>  'WechatController',
        'stripe'    =>  'StripeController',
        'stripe-test'    =>  'StripeTestController'
    ]);
});